var setCommand = function(button, func ){
    button.onclick = function(){
        func();
    }
}

var MenuBar = {
    refresh: function(){
        console.log('刷新菜单界面');
    }
}

var RefreshMenuBarCommand = function(receiver){
    return function(){
        receiver.refresh();
    }
};

var refreshMenuBarCommand = new RefreshMenuBarCommand(MenuBar)


setCommand(button1,refreshMenuBarCommand)